package com.runfast.waimai.service.impl;

import com.runfast.common.service.BaseService;
import com.runfast.waimai.dao.model.RunfastBusinessAccounts;
import com.runfast.waimai.dao.model.RunfastBusinessAccountsExample;
import com.runfast.waimai.service.RunfastBusinessAccountsService;
import org.springframework.stereotype.Service;
import java.util.List;

@Service
public class RunfastBusinessAccountsServiceImpl extends BaseService<RunfastBusinessAccounts, Integer, RunfastBusinessAccountsExample> implements RunfastBusinessAccountsService {

    //RunfastBusinessAccountsMapper runfastBusinessAccountsMapper=(RunfastBusinessAccountsMapper)this.mapper;
    public RunfastBusinessAccounts findByAccounts(String accounts){
        RunfastBusinessAccounts runfastBusinessAccounts=new RunfastBusinessAccounts();
        RunfastBusinessAccountsExample example=new RunfastBusinessAccountsExample();
        example.createCriteria().andAccountsEqualTo(accounts);
        List<RunfastBusinessAccounts> list=mapper.selectByExample(example);
        if(list.size()>0){
            runfastBusinessAccounts=list.get(0);
        }else{runfastBusinessAccounts=null;}
        return  runfastBusinessAccounts;
    }
}